package com.mask.im.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author jian
 */

@Getter
@AllArgsConstructor
public enum RecoverPasswordEnum {
    PHONE_RECOVER_PASSWORD("phoneRecoverPassword", "phoneRecoverPasswordImpl"),
    EMAIL_RECOVER_PASSWORD("emailPasswordRecovery", "emailPasswordRecoveryImpl");
    private final String type;
    private final String executor;

    public static String execute(String type) {
        for (RecoverPasswordEnum value : RecoverPasswordEnum.values()) {
            if (type != null && type.equals(value.type)) {
                return value.executor;
            }
        }
        return null;
    }
}
